package com.fzg.service.impl;

import com.fzg.common.enums.ResponseWrapper;
import com.fzg.entity.RecruitmentEnterprise;
import com.fzg.mapper.RecruitmentEnterpriseMapper;
import com.fzg.service.RecruitmentEnterpriseService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 企业-招聘表 服务实现类
 * </p>
 *
 * @author fzg
 * @since 2021-12-13
 */
@Service
public class RecruitmentEnterpriseServiceImpl extends ServiceImpl<RecruitmentEnterpriseMapper, RecruitmentEnterprise> implements RecruitmentEnterpriseService {

    @Autowired
    private RecruitmentEnterpriseMapper recruitmentEnterpriseMapper;

    /**
     * 获取所有企业发布的招聘信息
     *
     * @return ResponseWrapper
     */
    @Override
    public ResponseWrapper getAllRecruitInfo() {
        ArrayList<RecruitmentEnterprise> result = new ArrayList<>();
        List<RecruitmentEnterprise> recruitmentEnterprises = recruitmentEnterpriseMapper.selectList(null);
        if (recruitmentEnterprises.size()>0){
            return ResponseWrapper.markSuccess(recruitmentEnterprises);
        }else {
            return ResponseWrapper.markSuccess(result);
        }
    }
}
